package com.ruoyi.gis.service.impl;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.gis.domain.GisDictData;
import com.ruoyi.gis.mapper.GisDictDataMapper;
import com.ruoyi.gis.service.IGisDictDataService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 字典数据Service业务层处理
 *
 * @author rww
 * @date 2023-02-20
 */
@Service
public class GisDictDataServiceImpl implements IGisDictDataService
{
    @Autowired
    private GisDictDataMapper gisDictDataMapper;

    /**
     * 查询字典数据
     *
     * @param dictCode 字典数据主键
     * @return 字典数据
     */
    @Override
    public GisDictData selectGisDictDataByDictCode(Long dictCode)
    {
        return gisDictDataMapper.selectGisDictDataByDictCode(dictCode);
    }

    /**
     * 查询字典数据列表
     *
     * @param GisDictData 字典数据
     * @return 字典数据
     */
    @Override
    public List<GisDictData> selectGisDictDataList(GisDictData GisDictData)
    {
        return gisDictDataMapper.selectGisDictDataList(GisDictData);
    }

    /**
     * 新增字典数据
     *
     * @param GisDictData 字典数据
     * @return 结果
     */
    @Override
    public int insertGisDictData(GisDictData GisDictData)
    {
        GisDictData.setCreateTime(DateUtils.getNowDate());
        return gisDictDataMapper.insertGisDictData(GisDictData);
    }

    /**
     * 修改字典数据
     *
     * @param GisDictData 字典数据
     * @return 结果
     */
    @Override
    public int updateGisDictData(GisDictData GisDictData)
    {
        GisDictData.setUpdateTime(DateUtils.getNowDate());
        return gisDictDataMapper.updateGisDictData(GisDictData);
    }

    /**
     * 批量删除字典数据
     *
     * @param dictCodes 需要删除的字典数据主键
     * @return 结果
     */
    @Override
    public int deleteGisDictDataByDictCodes(Long[] dictCodes)
    {
        return gisDictDataMapper.deleteGisDictDataByDictCodes(dictCodes);
    }

    /**
     * 删除字典数据信息
     *
     * @param dictCode 字典数据主键
     * @return 结果
     */
    @Override
    public int deleteGisDictDataByDictCode(Long dictCode)
    {
        return gisDictDataMapper.deleteGisDictDataByDictCode(dictCode);
    }
}
